<?php

class RTHKDemoData extends DemoData
{

    /**
     * default demo data
     */
    static public function init($params)
    {
        $result['state'] = 1;
        $result['error'] = null;
        $result['data']  = array();

        return $result;
    }

    /**
     * render page demo data
     */
    static public function render($params)
    {
        $result['state'] = 1;
        $result['error'] = null;
        $result['data']['result'] = array('type'=>'dev','uname'=>'jimmy.zhao');
        $result['data']['options'] = array(
            array('text'=>'vcd','value'=>1),
            array('text'=>'dvd','value'=>2),
            array('text'=>'cd','value'=>3)
        );

        return $result;
    }

    /**
     * page list demo data handle
     * 
     * demo input:
     *      "rows":20
     *      "page":1
     *      "filters":"programme_code=2564&upid=GDRG56475&etv_programme_id=564&programme_title=HD&series_title=&episode_title=",
     *      "columns":"id,code,title,content"
     */
    static public function pagelist($params)
    {
        $result['state'] = 1;
        $result['error'] = null;
        $result['data']['result'] = array();
        $result['data']['page'] = 1;
        $result['data']['records'] = 100;
        $result['data']['total'] = 5;

        return $result;
    }

    /**
     * auto complete demo data
     *
     * demo input:
     *     "term":"ver",
     *     "limit":50,
     *     "columns":"id,code,title,content"
     */
    static public function autop($params)
    {
        $result['state'] = 1;
        $result['error'] = null;
        $result['data']['result'][]= array();

        return $result;
    }

    /**
     * save/delete operation demo data
     */
    static public function acid($params)
    {
        $result['state'] = 1;
        $result['error'] = null;
        $result['data']['upid'] = 'RTHK6789076';

        return $result;
    }
}
?>
